/**
 * @author chauvm
 */
	function load_topBanner(){
	   var so = new SWFObject("layouts/layout_1/images/banner.swf", "topbanner", "960", "227", "1", "#222323");
//				   var so = new SWFObject("http://vnexpress.net/Files/VAImages/VGB_364x90(1).swf?link=http%3A//vnexpress.net/Service/Counter/%3Fn%3D9143%26u%3Dhttp%253A//www.vgb.com.vn&amp;zoneid=undefined&amp;stop=undefined", "topbanner", "960", "227", "1", "#ffffff");
	   so.addParam("allowScriptAccess","always");
	   so.addParam("wmode","transparent");
	   so.write("block-flash");
	}
	function load_flash(number){
		for(i=1;i<=3;i++){
			if(i!=number){
				$("#" + i).removeClass("active");
			}
		}
		$("#" + number).addClass("active");
	}
	function load_fund(number){
		var num = parseInt(number);
		$("#t1").css("display", "none");
		$("#fund-" + 1).removeClass("active");
		for(i=2;i<=7;i++){
			if(i!=num+2){
				$("#t" + i).css("display", "none");
				$("#fund-" + i).removeClass("active");
			}
			else{
				$("#t" + i).css("display", "block");
				$("#fund-" + i).addClass("active");
			}
		}

		var htmlStr = $("#fund").html();
		$("#fund_change").text(htmlStr);
	}
	function load_tabs(number){
		var num = parseInt(number);
		for(i=1;i<=7;i++){
			if(i!=num){
				$("#t" + i).css("display", "none");
				$("#fund-" + i).removeClass("active");
			}
			else{
				$("#t" + i).css("display", "block");
				$("#fund-" + i).addClass("active");
			}
		}
	}
	
	function next_tab(){
		var num  = parseInt($("#tab").attr("value"));
		num = num + 1;
		$('a[href=#section'+ num +']').click();
		return false;
	}
	
	function back_tab(){
		var num  = parseInt($("#tab").attr("value"));
		num = num -1;
		$('a[href=#section'+ num +']').click();
	}
	
	function sendText(number) {
		var flash = document.getElementById("topbanner");
		flash.passText(number);
	}

	function sendFund(number) {
		var flash = document.getElementById("topbanner");
		//flash.passFund(number);
	}

	function load_report_ajax_page(l1,l2,l3,l4,year){
		$('#fund_all').val(0);
		year = $("#year_report").attr("value");
		$("#left_ajax").load("templates/content_report_ajax.php"+'?l1='+l1+'&l2='+l2+'&l3='+l3+'&l4='+l4+'&year='+year);
		$("#content-left ul.list_tab > li").removeClass('selected');
		if(l3>0)
			$("#report_"+l3).addClass('selected');
		else
			$("#report").addClass('selected');
		var url = l1+'&'+l2+'&'+l3+'&'+l4+'&'+year;
		$("#url_report").attr("value","");
		$("#url_report").attr("value",url);
		$("#left_year ul.list > li").removeClass('selected');
		$("#report_"+year).addClass('selected');
	}

	function load_news_ajax_page(l1,l2,l3,l4,year,page){
		$('#fund_all').val(0);
		year = $("#year_news").attr("value");
		fund_id = $("#fund_news").attr("value");
		$("#right_ajax").load("templates/content_news_ajax.php"+'?l1='+l1+'&l2='+l2+'&l3='+l3+'&l4='+l4+'&year='+ year+'&page='+page+'&fund_id='+fund_id);
		$("#content-center-full ul.list_tab_news > li").removeClass('selected');
		if(l3>0)
			$("#news_"+l3).addClass('selected');
		else
			$("#news").addClass('selected');

		var url = l1+'&'+l2+'&'+l3+'&'+l4+'&'+year;
		$("#url_news").attr("value","");
		$("#url_news").attr("value",url);
		$("#right_year ul.list > li").removeClass('selected');
		$("#news_"+year).addClass('selected');
	}
	
	function load_all_ajax_page(page){
		$('#fund_all').val(1);
		$('#funds_news').show();
		$('#funds_report_tab').hide();
		
		fund_id = $("#fund_news").attr("value");
		//alert(fund_id)
		$("#right_ajax").load("templates/content_media_ajax.php"+'?page='+page+'&fund_id='+fund_id);
		
		
		$("#content-center-full ul.list_tab_news > li").removeClass('selected');
		$("#news").addClass('selected');
	}
	
	function open_news(id){
		myRef = window.open('news.php?id='+id,'mywin','left=20,top=20,width=600,height=500,toolbar=1,resizable=0,scrollbars=1');
	}

	function change_tab(id){
		$('#people_list li').removeClass('selected');
		$("#cont div").css("display", "none" );
		$("#section"+id).css("display", "block");
		$("#"+id).addClass('selected');
		$("#tab").attr("value",id);
		return false;
	}

	function load_page(l1,l2,l3,l4){
		$("#content-center").load('ajax_page.php?l1='+ l1 + '&l2=' + l2 + '&l3=' + l3 + '&l4='+l4);
	}
	
	
	function change_position(str){
		$("#content_people .position").html(str);
	}
	
	function load_people_content(id,str){
		$("#position_name").attr("value",str);
		$('#content_people').load('templates/content_people_ajax.php?id='+ id + "#content_people" );
		$('#people_list li').removeClass('selected');
		$('#people_list > li span.full').css("display","none");
		$('#people_list > li span.desc').css("display","block");
		$('#people_'+id).addClass('selected');
		$('#people_'+id+" span.desc" ).css("display","none");
		$('#people_'+id+" span.full" ).css("display","block");
	}

	function load_fund(id){
		//$('#content-left').load('templates/content_menu_people_fund.php?id=' + id );
		//$('#content-right .other_team > div.block').css("display","none");
		//$('#content-right ul >li ul').css("display","none");
		$('#content-right .other_team > .parent >.block').css("display","none");
		$('#content-right .other_team > .parent a').removeClass('selected');
		$("#ul_"+id).show("slow");
		$('#people_list').load('templates/content_people_fund.php?id=' + id + "");
		$('#fund_'+id+ ' a').addClass('selected');
	}

	function load_menu_fund(id){
		$('#people_list').load('templates/content_people_fund.php?l_id=' + id);
		//$('#content-left ul > li').removeClass('selected');
		$('.other_team > .parent > .block > .child').removeClass('selected');
		$('#fund_menu_'+id).addClass('selected');
	}

	function change_fund(id){
		$("#fund_news").attr("value",id);
		$("#funds li").removeClass('selected');
		$("#fund_"+id).addClass('selected');
		//alert($('#fund_all').val())
		if ($('#fund_all').val()!=1){
			var url = $("#url_news").attr("value");
			var myString = new String(url);
			var myArray = myString.split('&');
			l1 = myArray[0];
			l2 = myArray[1];
			l3 = myArray[2];
			l4 = myArray[3];
			year = myArray[4];
			
			if (l3==151 || l3==152)
				l3 = 10000;
			
			load_news_ajax_page(l1,l2,l3,l4,year,0);
		} else {
			load_all_ajax_page(0);	
		}
	}

	function change_breadcrumb_fund(str){
		$("#breadcrumb li.active").html(str);
		$("#breadcrumb li.active").removeClass("active");
	}

	function change_breadcrumb(str){
		$("#breadcrumb li.last").css("display","block");
		$("#breadcrumb li.last:last").html(str);
		$("#breadcrumb li.last:last").addClass("active");
	}
	
	function change_funds(id){
		$("#fund_"+id+" ul").css("display","block");
	}
	
	function load_report_ajax_page(l1,l2,l3,l4,year){
		year = $("#year_report").attr("value");
		$("#left_ajax").load("templates/content_report_ajax.php"+'?l1='+l1+'&l2='+l2+'&l3='+l3+'&l4='+l4+'&year='+year);
		$("#content-left ul.list_tab > li").removeClass('selected');
		if(l3>0)
			$("#report_"+l3).addClass('selected');
		else
			$("#report").addClass('selected');
		var url = l1+'&'+l2+'&'+l3+'&'+l4+'&'+year;
		$("#url_report").attr("value","");
		$("#url_report").attr("value",url);
		$("#left_year ul.list > li").removeClass('selected');
		$("#report_"+year).addClass('selected');
	}

	function load_report_tab_ajax_page(l1,l2,l3,l4,year,fund_type,page){
		//alert('l1:'+l1+' l2:'+l2+' l3:'+l3+' l4:'+l4+' year:'+year);
		year = $("#year_report").attr("value");
		fund_id = $("#fund_news").attr("value");
		
		$('#funds_news').hide();
		$('#funds_report_tab').show();
		
		$("#right_ajax").load("templates/content_report_tab_ajax.php"+'?l1='+l1+'&l2='+l2+'&l3='+l3+'&l4='+l4+'&year='+year+'&fund_type='+fund_type+'&page='+page);
		
		$("#content-center-full ul.list_tab_news > li").removeClass('selected');

		var url = l1+'&'+l2+'&'+l3+'&'+l4+'&'+year+'&'+fund_type;
		$("#url_report_tab").attr("value","");
		$("#url_report_tab").attr("value",url);
		$("#right_year ul.list > li").removeClass('selected');
		$("#report_tab").addClass('selected');
		
		
		$("#funds_report_ul li").removeClass('selected');
		if(l3>0)
			$("#funds_report_ul li#fund_report_"+l3).addClass('selected');
		else
			$("#funds_report_ul li#fund_report_0").addClass('selected');
			
		$("#type_report_ul li").removeClass('selected');
		//if(fund_type>0)
			$("#type_report_ul li#fund_type_"+fund_type).addClass('selected');

	}
	
	function load_news_ajax_page(l1,l2,l3,l4,year,page){
		$('#fund_all').val(0);
		year = $("#year_news").attr("value");
		fund_id = $("#fund_news").attr("value");
		
		$('#funds_news').show();
		$('#funds_report_tab').hide();
		
		$("#right_ajax").load("templates/content_news_ajax.php"+'?l1='+l1+'&l2='+l2+'&l3='+l3+'&l4='+l4+'&year='+ year+'&page='+page+'&fund_id='+fund_id);
		$("#content-center-full ul.list_tab_news > li").removeClass('selected');
		//alert(l3)
		if(l3>0) {
			if (l3==151 || l3==152 || l3==10000)
				$("#news_10000").addClass('selected');
			else 
				$("#news_"+l3).addClass('selected');
		} else
			$("#news").addClass('selected');

		var url = l1+'&'+l2+'&'+l3+'&'+l4+'&'+year;
		//alert(url);
		$("#url_news").attr("value","");
		$("#url_news").attr("value",url);
		$("#right_year ul.list > li").removeClass('selected');
		$("#news_"+year).addClass('selected');
	}
	
	function open_vacancy(id){
		myRef = window.open('vacancy.php?id='+id,'mywin','left=20,top=20,width=600,height=500,toolbar=1,resizable=0,scrollbars=1');
	}
	function getUrlVars() {
		var vars = {};
		var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
		    vars[key] = value;
		});
		return vars;
	}